#include <stdio.h>

/*谜语博士的难题（2）*/

void main()
{
    int a,b,c,aa,bb,cc;
    for(a=0;a<=1;a++)
        for(b=0;b<=1;b++)
            for(c=0;c<=1;c++)
                for(aa=0;aa<=1;aa++)
                    for(bb=0;bb<=1;bb++)
                        for(cc=0;cc<=1;cc++)
                        if(a+aa!=2&&b+b!=2&&c+cc!=2 &&
                            a+b+c==1&&aa+bb+cc==1 &&
                            (a&&!aa&&b&&!bb||!a&&!b) &&
                            !b                    &&
                            (c&&!b&&!bb||(!c&&!cc)&&(b||bb)||!c&&cc))
                            {
                                printf("The man stand on the left is a %s.\n",
                                aa?"double_dealer":(a?"honest":"lier"));
                                 printf("The man stand on center is a %s.\n",
                                bb?"double_dealer":(b?"honest":"lier"));
                                 printf("The man stand on the right is a %s.\n",
                                cc?"double_dealer":(c?"honest":"lier"));
                            }
}
